package com.vegetable.modules.vo.stock;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 成本分摊记录VO（包含商品信息）
 */
@Data
@ApiModel(value = "成本分摊记录VO", description = "包含商品信息的成本分摊记录")
public class CostAllocationRecordVO {

    @ApiModelProperty(value = "主键ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "原始库存ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long originalStockId;

    @ApiModelProperty(value = "分摊后新创建的库存ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long allocatedStockId;

    @ApiModelProperty(value = "分摊批次号")
    private String allocationBatchNo;

    @ApiModelProperty(value = "分摊总成本")
    private BigDecimal totalCost;

    @ApiModelProperty(value = "分摊前成本单价")
    private BigDecimal beforeCostWeight;

    @ApiModelProperty(value = "分摊后成本单价")
    private BigDecimal afterCostWeight;

    @ApiModelProperty(value = "库存重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "单位重量成本")
    private BigDecimal unitCost;

    @ApiModelProperty(value = "操作人ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long operatorId;

    @ApiModelProperty(value = "操作人名称")
    private String operatorName;

    @ApiModelProperty(value = "分摊说明")
    private String remark;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    // 商品相关信息
    @ApiModelProperty(value = "商品ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long commodityId;

    @ApiModelProperty(value = "商品名称")
    private String commodityName;

    @ApiModelProperty(value = "商品编码")
    private String commonCode;

    @ApiModelProperty(value = "规格ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long specsId;

    @ApiModelProperty(value = "规格名称")
    private String specsName;

    @ApiModelProperty(value = "标准")
    private BigDecimal standard;

    @ApiModelProperty(value = "商品类型名称")
    private String category;

    @ApiModelProperty(value = "仓库名称")
    private String warehouseName;

    @ApiModelProperty(value = "库存批次编码")
    private String stockBatchNo;
}